package cn.topcodes.tcsf.admin.commons.api;

import cn.topcodes.tcsf.admin.commons.ApplicationStartedListener;
import org.springframework.web.WebApplicationInitializer;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;

/**
 * @author Unicorn
 * @date 2017/6/9
 */
public class TCSFApplicationInitializer implements WebApplicationInitializer {

    @Override
    public void onStartup(ServletContext servletContext) throws ServletException {
        System.err.println("应用程序正在启动...");
        ApplicationStartedListener.startTime = System.currentTimeMillis();

        /*servletContext.setInitParameter("contextConfigLocation","classpath*:spring/applicationContext.xml");
        servletContext.setInitParameter("spring.profiles.default","development");

        servletContext.addListener(ContextLoaderListener.class);

        CharacterEncodingFilter encodingFilter = new CharacterEncodingFilter("UTF-8",true);
        FilterRegistration.Dynamic dynameic = servletContext.addFilter("encodingFilter",encodingFilter );
        dynameic.addMappingForUrlPatterns(
                EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWARD, DispatcherType.INCLUDE),
                false,"*//*");*/


    }
}
